feat(compute): flavor extra_specs, instance resize + image_name, interface/volume attach - #14
Merged
Merged
Conversation
…rface/volume attach - pcd_compute_flavor: settable extra_specs (add/change/remove in place via Create/List/Delete extra-spec calls). Made the other flavor attributes (ram/vcpus/disk/swap/rx_tx_factor/is_public/ephemeral) RequiresReplace to match the resource's documented immutability, so Update is exclusively about extra_specs and non-extra-spec changes no longer silently drift. - pcd_compute_instance: flavor changes now trigger an in-place resize (Resize -> wait VERIFY_RESIZE -> ConfirmResize -> wait ACTIVE, best-effort RevertResize on failure) instead of forcing a new resource; flavor_id/flavor_name are no longer ForceNew. Added image_name as an alternative to image_id, resolved via Glance (exactly one required; image change stays ForceNew). - New pcd_compute_interface_attach: attach a network interface to a server by port_id or network_id (composite id instance_id/port_id, echo-only fixed_ip). - New pcd_compute_volume_attach: attach a Cinder volume to a server; best-effort volume-status wait degrades gracefully when no block-storage backend is present. Acceptance tests added/extended (flavor extra_specs in-place update, instance resize + image_name, interface/volume attach). build/vet/gofmt/golangci-lint (0 issues) and tfplugindocs all clean.
Dropping RequiresReplace from flavor_id (to allow resize) left it with UseStateForUnknown, which pinned the stale flavor_id into the plan when a resize was driven by flavor_name — the applied new id then mismatched the plan and Terraform aborted with 'inconsistent result after apply'. Remove the plan modifier so flavor_id goes unknown on change, and always set the resolved flavor_id in Update (not only inside the resize branch). Found by adversarial review.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(compute): flavor extra_specs, instance resize + image_name, interface/volume attach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2 (Phase 1 follow-ups) — the compute batch.
Changes
pcd_compute_flavorextra_specs— settable key/value map, added/changed/removed in place (Create/List/Delete extra-spec calls). Also made the other flavor attributes (ram/vcpus/disk/swap/rx_tx_factor/is_public/ephemeral)RequiresReplaceto match the resource's documented immutability, soUpdateis exclusively aboutextra_specsand non-extra-spec changes no longer silently drift.pcd_compute_instanceresize — a flavor change now triggers an in-place resize (Resize→ waitVERIFY_RESIZE→ConfirmResize→ waitACTIVE, best-effortRevertResizeon failure) instead of forcing a new resource.pcd_compute_instanceimage_name— boot by image name (resolved via Glance), an alternative toimage_id(exactly one required; image change staysForceNew).pcd_compute_interface_attach— attach a port/network to a server (composite idinstance_id/port_id, echo-onlyfixed_ip).pcd_compute_volume_attach— attach a Cinder volume to a server; the volume-status wait is best-effort and degrades gracefully when there's no block-storage backend.Adversarial review fix included
flavor_id(now in-place-updatable) keptUseStateForUnknown, which pinned the stale id into the plan when a resize was driven byflavor_name→ the applied new id mismatched the plan → "inconsistent result after apply" on everyflavor_name-driven resize. Removed the plan modifier and madeUpdatealways set the resolvedflavor_id.Live-validation status
Code-complete; all static checks green. Flavor
extra_specsis live-testable (flavors work on the lab); the resize/attach paths need a bootable instance (and Cinder for volume attach) — currently lab-blocked. Not yet run against the lab this session (credentials unavailable). Tracked inDECISIONS.md.build / vet / gofmt / golangci-lint (0 issues) / tfplugindocs all clean.